<!DOCTYPE html>
<html>
<head>
    <!--<title>{$post_title}{$site_name}</title>-->
    <title>{$article['post_title']}</title>
    <meta name="keywords" content="{$article['post_keywords']}" />
    <meta name="description" content="{$article['post_excerpt']}">
    <script src="__PUBLIC__/js/wx/jweixin-1.4.0.js"></script>
    <tc_include file="Public:head" />
    <style type="text/css">
        .article_content img {
            height: auto !important;
        }

        .article_content {
            word-wrap: break-word;
        }
        .sl_user_name a {
            display: inline-block;
            width: 74px;
            height:38px;
            overflow: hidden;
            background:url('./public/images/img/rxzl.png') no-repeat right bottom ;
            margin: 0 0 -5px 5px;

        }
        .comment-postbox {width:100%!important;}
        .control-group {width:100%!important;}
        /*.comment-postbox-wraper  {border: 1px solid #000232;}*/
        .comment-postbox-wraper textarea {
            border-color: #707070;
            resize: none;
        }
        .shoucang1 {
            background:url('/themes/simplebootx/Public/assets/images/收藏.png') no-repeat center;
            width:20px;
            height: 21px;
            float: none;
        }

        .list-unstyled li a {
            color: #000232!important;
            border:1px solid #000232;
            height: 22px;
            margin: 2px 9px;
            font-size: 16px;
            line-height: 22px;
            letter-spacing: 2px;
        }
        .count{
            color: #000232;
        }

        .tips_success{
            display: inline-block;
            width: 150px;
        }

        .tips_error{
            display: inline-block;
            width: 150px;
        }
        .newsFlash .new_list i {
            font-size: 10px;
        }
        .newsFlash .new_list {
            font-size: 18px;
        }
        /*分享微信样式开始*/
        .wx_icon1 {margin-right:34px;position: relative;top: 4px; display: inline-block;width: 20px;height:18px;background: url("/public/images/img/wx_lg.png") no-repeat center bottom;background-size: 20px 18px; margin-left: 6px;}
        .share-code {
            position: absolute;
            top: -88px;
            left: -36px;
            width: 140px;
            height:60px;
            padding:10px 10px 10px 80px;
            box-shadow: 0 0 2px #ddd;
            font-size: 14px;
            line-height: 20px;
            background-color: #fff;
            display: none;
        }
        .wx_icon1:hover .share-code{
            display: block;
        }
        .share-code img {
            position: absolute;
            left: 0px;
            top: 0px;
            width: 80px;
            height: 80px;
        }
        /*广告位样式*/
        .article_advertisement {
            margin-top: 20px;
            padding: 0 6px;
        }
        .article_advertisement img{
            width: 100%;
            height: auto;
        }
        .newsFlash h2 {
            margin-top: 40px!important;
        }

        /*分享微信样式结束*/
        @media screen and (max-width: 751px){
            .wx_icon1 {
                display: none!important;
            }
            .article_advertisement {
                margin-top: 10px;
                padding: 0 6px;
            }

        }
        /*针对移动端样式调整*/
        @media screen and (max-width: 705px){
            .tc-box {
                padding: 5px 0!important;
            }
            h2.fontmsyhbd {
                font-size: 22px!important;
                line-height: 32px;
                white-space: normal;
            }
            #article_content p, .article_content p {
                margin-top: 12px;
            }
            #article_content h2, .article_content h2 {
                margin-top:12px;
            }
            #article_content h1, .article_content h1 {
                margin-top: 24px;
            }
            .list-unstyled li a{
                color: #000232!important;
                border: 1px solid #000232;
                height: 22px;
                margin: 2px 6px;
                font-size: 12px;
                line-height: 22px;
                letter-spacing: 1px;
            }
            .yd_change a {
                margin-right: 24px!important;
            }
            #comments .btn-primary {
                padding-top: 0;
                padding-bottom: 0;
                line-height: 30px!important;
            }
            .tc-box .article_content img {
                width: 100%!important;
                max-width: 100%;
            }
            .span3 {
                display: none;
            }
            /*小程序样式调整*/
            body{
                padding-left: 0;
                padding-right: 0;
                margin-left: 20px;
                margin-right: 20px;
            }
        }
    </style>
</head>
<body class="">
<tc_include file="Public:nav" />
<div class="container tc-main">
    <div class="search-result" style="float: left;width: 760px;margin-left: -9999px;">
        <img src="/public/images/img/search-result.jpg" alt="日新网" style="width: 121px;height: 75px;">
        <p>
            <a href="http://www.rixins.com" title="日新网">日新网</a>是一家致力于推动新科技、新理念、新政策引入房地产后市场的产业创新服务平台。
            “日新”语出《大学》——“苟日新，日日新，又日新”。<a href="http://www.rixins.com" title="日新网">日新网</a>专注用新科技、新理念、新政策、
            新模式妆点房产后市场，让新生活更近一点，让科技落地更从容一点。旗下拥有创新行业资讯日新网、
            创新专业培训日新研习社、创新企业孵化成长日新商脉三款产品，以住宅、商业地产、
            写字楼等不同业态物业经营的增效减能与增值创新以及服务标准化、
            物业智能化、信息化等策略方向的创新为主要研究内容，共同助力日新网成为物业行业创新风向标。
        </p>
    </div>
    <div class="row">
        <div class="span9" style="max-width: 760px;">
            <div class="tc-box first-box article-box new_comment">
                <h2 class="fontmsyhbd" style="white-space: normal;">{$article['post_title']}</h2>
                <div class="article-infobox">
                    <php>
                        $smeta = json_decode($article['smeta'], true);
                        $postdate = time_format($article['post_date']);
                    </php>
                    <span style="font-size: 11px;color: #686568;">
                            <span style="color: #1367ef;font-size: 14px;">文/{$article['post_author_name']|default=$article['user_nicename']} </span>
                            · {$postdate}
                        </span>
                </div>
                <br/>
                <div id="article_excerpt" style="background-color:#f3f3f3;padding:15px 0 15px 5px;line-height:30px;font-size:large">
                    <b style="font-size: 14pt;color: #000000;">日新观点：</b>
                    <span style="font-size: 12pt;color: #444444;">{$article['post_excerpt']}</span>
                    <br />
                </div>

                <div class="article_content">
                    {$article['post_content']}
                </div>

                <php>$article['post_source'] = $article['post_source'] ?: "日新网"</php>
                <if condition="!empty($article['declare'])">
                    <div style="margin-top: 12px;">
                        <b>{$article['declare']}</b>
                    </div>
                </if>

                <if condition="empty($article['declare'])">
                    <div style="margin-top: 12px;">
                        <b>注：本文转载自{$article['post_source']}，转载目的在于传递更多信息，并不代表本网赞同其观点和对其真实性负责。如有侵权行为，请联系我们，我们会及时删除。</b>
                    </div>
                </if>

                <img id="article_thumb" src="{:sp_get_asset_upload_path($smeta['thumb_local_path'])}" style="width: 0px;height: 0px;">

                <div id="share_tip"></div>
                <!--标签-->
                <if condition="!empty($article['labels'])">
                    <div class="tc-box">
                        <span class="fontmsyhbd" style="float: left;font-size: 15px;margin-top: 10px;">标签 : </span>
                        <ul class="list-unstyled tc-photos margin-bottom-30" style="margin:5px 5px">
                            <volist name="article.label_names" id="vo_la">
                                <li>
                                    <a data-unused-href="{:leuu('list/index',array('id'=>$voterm['term_id']))}">{$vo_la}</a>
                                </li>
                            </volist>
                        </ul>
                    </div>
                </if>
                <if condition="$article['can_comment'] == 1">
                    <div style="height: 26px;max-width: 679px;">
                        <div style="float: right;" class="yd_change">
                            <a style="float: left;margin-right: 40px;" href="{:U('article/do_like', array('id' => $article_id, 'from_id' => $article['post_author']))}" class="js-count-btn">
                                <i><img class="dianzan" src="/themes/simplebootx/Public/assets/images/dianzan.png" alt="点赞"/></i>
                                (<span class="count" >{$article['post_like']}</span>)
                            </a>
                            <div class="wx_icon1">
                                <div class="share-code">
                                    <img src="{$qrcode}" alt="">
                                    打开微信“扫一扫”，打开网页后点击屏幕右上角分享按钮
                                    <span class="sanjiao" ></span>
                                </div>
                            </div>
                            <a id="{$article_id}" style="float: left;margin-right: 30px;" data-href="{:U('user/favorite/do_favorite', array('id' => $article_id, 'from_id' => $article['post_author']))}" class="collect-btn">
                                <i style = "float:none;">
                                    <div class="shoucang1" ></div>
                                </i>
                            </a>
                        </div>
                    </div>

                    <!--文章详情页广告位-->
                    <if condition="!empty($advertisement)">
                        <a href="{$advertisement.post_source}">
                            <div class="article_advertisement">
                                <img src="{$advertisement.thumb_img}">
                            </div>
                        </a>
                    </if>

                    {:hook('comment',array(
                    'post_id'=>$article_id,
                    'post_table'=>'posts',
                    'post_title'=>$article['post_title']
                    ))}
                </if>
            </div>
        </div>
        <div class="span3" style="width: 350px;">
            <!-- 快讯 -->
            <if condition="!empty($article['post_author'])">
                <div class="sl_user"  style="margin-top: 30px;" >

                    <div class="sl_user_pc">
                        <img src="{:sp_get_user_avatar_url($article['avatar'])}?t={:time()}" alt="作者" >
                        <p class="sl_user_name">
                            {$article.post_author_name}
                            <if condition="$article['professor'] == 1">
                                <a href="javascript:;"></a>
                            </if>
                        </p>
                    </div>


                    <!--最近文章-->
                    <php>
                        $recent_articles = get_recent_article($article['post_author']);
                    </php>

                    <if condition="!empty($recent_articles)">
                        <div class="newsFlash" id="newsFlash">
                            <h2>最近文章</h2>
                            <ul style="margin-left: 0;width: 342px; overflow: hidden;">
                                <volist name="recent_articles" id="vo">
                                    <a href="{:leuu('article/article_info',array('id' => $vo['id']))}">
                                        <li class="new_list">
                                             <span class="title">
                                                 {$vo.post_title}
                                             </span>
                                            <span class="timer">{$vo.post_date} </span>
                                        </li>
                                    </a>
                                </volist>
                            </ul>
                        </div>
                    </if>
                </div>
            </if>
            <!-- 相关文章 -->
            <php>
                $labels         = $article['labels'];
                $related_post   = get_related_article($labels);
            </php>
            <if condition="!empty($related_post)">
                <div class="Related_news" >
                    <div class="newsFlash" >
                        <h2>相关文章</h2>
                        <ul style="margin-left: 0;width: 342px; overflow: hidden;">
                            <volist name="related_post" id="vo">
                                <li class="new_list">
                                        <span class="title">
                                            <a href="{:leuu('article/article_info',array('id' => $vo['id']))}">{$vo.post_title}</a>
                                        </span>
                                    <span class="timer">{$vo.post_date}</span>
                                </li>
                            </volist>
                        </ul>
                    </div>
                </div>
            </if>
        </div>
    </div>
</div>
<tc_include file="Public:footer" />
<tc_include file="Public:scripts" />

<!--小程序内分享-->
<script type="text/javascript" src="__PUBLIC__/js/wx/jweixin-1.3.2.js"></script>
<script>
    $(function () {
        // 判断是否是小程序打开
        wx.miniProgram.getEnv(function(res) {
            if (res.miniprogram) { //在小程序中
                var tip = '<sapn style="color: #ff7c3b">点击右上角...分享~</sapn>';
                $('#share_tip').html(tip);
            }
        });
    })
</script>

<script>
    // 判断用户是否登录
    $(function () {
        var $btn = $(".control-group button");
        var $reply = $(".fa-comment");
        $btn.click(function () {
            $.post("{:U('user/index/is_login')}", {}, function (data) {
                if (data.status == 1) {
                    if (data.user.avatar) {
                        $("#main-menu-user .headicon").attr("src", data.user.avatar.indexOf("http") == 0 ? data.user.avatar : "{:sp_get_image_url('[AVATAR]','!avatar')}".replace('[AVATAR]', data.user.avatar));
                    }
                    $("#main-menu-user .user-nicename").text(data.user.user_nicename != "" ? data.user.user_nicename : data.user.user_login);
                    $("#main-menu-user li.login").show();
                    // window.location.reload();
                }
                if (data.status == 0) {
                    $("#main-menu-user li.offline").show();
                    window.location.href = "{:leuu('user/login/index')}";
                }
            });
        });
        $reply.click(function () {
            $.post("{:U('user/index/is_login')}", {}, function (data) {
                if (data.status == 1) {
                    if (data.user.avatar) {
                        $("#main-menu-user .headicon").attr("src", data.user.avatar.indexOf("http") == 0 ? data.user.avatar : "{:sp_get_image_url('[AVATAR]','!avatar')}".replace('[AVATAR]', data.user.avatar));
                    }
                    $("#main-menu-user .user-nicename").text(data.user.user_nicename != "" ? data.user.user_nicename : data.user.user_login);
                    $("#main-menu-user li.login").show();
                }
                if (data.status == 0) {
                    $("#main-menu-user li.offline").show();
                    window.location.href = "{:leuu('user/login/index')}";
                }
            });
        });
    })
</script>

<!--微信分享-->
<script src="__PUBLIC__/js/wx/jweixin-1.4.0.js"></script>

<script type="text/javascript">
    wx.config({
        debug: false,
        appId: '{$signPackage.appId}',
        timestamp: '{$signPackage.timestamp}',
        nonceStr: '{$signPackage.nonceStr}',
        signature: '{$signPackage.signature}',
        jsApiList: [
            // 所有要调用的 API 都要加到这个列表中
            'checkJsApi',
            'onMenuShareAppMessage',
            'onMenuShareTimeline'
        ]
    });

    //完成wx.config，执行这里
    wx.ready(function () {

        wx.checkJsApi({
            jsApiList: ['onMenuShareAppMessage', 'onMenuShareTimeline'], // 需要检测的JS接口列表，所有JS接口列表见附录2,
        });
        <?php
            $op      = array("\r\n","\n","\r",' ');
            $excerpt = str_replace($op, '', $article["post_excerpt"]);
        ?>

        var data = {
            title: "{$article['post_title']}",
            desc: '{$excerpt}',
            link: window.location.href,
            imgUrl: $('#article_thumb').attr('src'),
        }

        //分享给朋友
        wx.onMenuShareAppMessage(data);
        //分享到朋友圈
        wx.onMenuShareTimeline(data);
    });

    // wx.error(function (res) {
    //     alert(res.errMsg); // 错误信息
    // });
</script>
<!--小程序滑动返回-->
<script>
    $(function () {
      
        $("body").on("touchstart", function(e) {
            // 判断默认行为是否可以被禁用
            if (e.cancelable) {
                // 判断默认行为是否已经被禁用
                if (!e.defaultPrevented) {
                    e.preventDefault();
                }
            }
            startX = e.originalEvent.changedTouches[0].pageX,
                startY = e.originalEvent.changedTouches[0].pageY;
        });
        $("body").on("touchend", function(e) {
            // 判断默认行为是否可以被禁用
            // if (e.cancelable) {
            //     // 判断默认行为是否已经被禁用
            //     if (!e.defaultPrevented) {
            //         e.preventDefault();
            //     }
            // }
            var moveEndX = e.originalEvent.changedTouches[0].pageX,
                moveEndY = e.originalEvent.changedTouches[0].pageY,
                X = moveEndX - startX,
                Y = moveEndY - startY;
            //左滑
            if (startX < 40 && X > 150 && -20 < Y < 20) {
                if(history.go(-1)){
                    window.history.go(-1);
                }else {
                    return;
                }
            }
            //右滑
            else if ( X < 0 && Y < 30 && Y > -30) {
                if(history.go(1)){
                    window.history.go(1);
                }else{
                    return;
                }
            }
        });
    })
</script>
</body>
</html>